#include <memory>
#include<vector>

#include "rclcpp/rclcpp.hpp"
#include "std_msgs/msg/float32_multi_array.hpp"
using std::placeholders::_1;
using namespace std;

class NavpieSubscriber : public rclcpp::Node
{
  public:
    NavpieSubscriber()
    : Node("navpie_subscriber")
    {
      subscription_ = this->create_subscription<std_msgs::msg::Float32MultiArray>(
      "navpie", 10, std::bind(&NavpieSubscriber::topic_callback, this, _1));
    }

  private:
    void topic_callback(const std_msgs::msg::Float32MultiArray::SharedPtr msg) const
    {
      RCLCPP_INFO(this->get_logger(), "%6.3f s: %5.2f %5.2f %5.2f  %5.2f %5.2f %5.2f  %5.2f %5.2f %5.2f", msg->data.at(0), msg->data.at(1), msg->data.at(2), msg->data.at(3), msg->data.at(4), msg->data.at(5), msg->data.at(6),
      msg->data.at(12), msg->data.at(13), msg->data.at(14));
    }
    rclcpp::Subscription<std_msgs::msg::Float32MultiArray>::SharedPtr subscription_;
};

int main(int argc, char * argv[])
{
  rclcpp::init(argc, argv);
  rclcpp::spin(std::make_shared<NavpieSubscriber>());
  rclcpp::shutdown();
  return 0;
}